package com.wandian.news.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mylib.libcore.utils.UIUtils;
import com.wandian.news.R;
import com.wandian.news.bean.LifeMenuBean;


/**
 * @author Administrator
 * @date 2019/12/16-13:32
 * @description 适配器
 **/
public class LifeMenuRecycleAdapter extends BaseQuickAdapter<LifeMenuBean.NewslistEntity, BaseViewHolder> {

    public LifeMenuRecycleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, LifeMenuBean.NewslistEntity item) {
        TextView tv_menu_name = helper.getView(R.id.tv_menu_name);
        TextView tv_menu_zf = helper.getView(R.id.tv_menu_zf);
        TextView tv_menu_tl = helper.getView(R.id.tv_menu_tl);
        TextView tv_menu_yl = helper.getView(R.id.tv_menu_yl);
        TextView tv_menu_pj = helper.getView(R.id.tv_menu_pj);
        TextView tv_menu_zy = helper.getView(R.id.tv_menu_zy);
        tv_menu_name.setText(item.getCp_name()+"");

        if(!UIUtils.isEmpty(item.getZuofa())){
            tv_menu_zf.setText("做法："+item.getZuofa());
        }
        if(!UIUtils.isEmpty(item.getTiaoliao())){
            tv_menu_tl.setText("调料："+item.getTiaoliao());
        }
        if(!UIUtils.isEmpty(item.getYuanliao())){
            tv_menu_yl.setText("原料："+item.getYuanliao());
        }
        if(!UIUtils.isEmpty(item.getTexing())){
            tv_menu_pj.setText("评价："+item.getTexing());
        }
        if(!UIUtils.isEmpty(item.getTishi())){
            tv_menu_zy.setText("小技巧："+item.getTishi());
        }
    }


}
